import '../configs/urls_config.dart';
import '../models/login_request.dart';
import '../models/login_response.dart';
import '../utils/http.dart';

Future<LoginResponse> login(LoginRequest loginRequest) async {
  Uri url = UrlsConfig.buildUrl(UrlsConfig.authOperations.loginUrl);
  dynamic json = await HttpUtil.instance.fetchJson(
    url,
    HttpOptions(
      method: 'POST',
      body: loginRequest,
    ),
  );
  return LoginResponse.fromJson(json);
}
